import request from '@/utils/request'

// 组卷列表
export function getFolderList(query) {
  return request({
    url: 'archive/collection/receive/folder/list',
    method: 'get',
    params: query
  })
}

// 获取类号
export function getCategoryNum(query) {
  return request({
    url: 'archive/collection/data/category/code',
    method: 'post',
    params: query
  })
}

// 组卷著录
export function addFolder(data) {
  return request({
    url: 'archive/collection/receive/add/folder',
    method: 'post',
    data: data
  })
}

// 获取卷详情
export function getFolderDetail(id) {
  return request({
    url: '/archive/collection/receive/folder/' + id,
    method: 'get'
  })
}

// 组卷修改
export function updateFolder(data) {
  return request({
    url: '/archive/collection/receive/edit/folder',
    method: 'put',
    data: data
  })
}

// 组卷删除
export function deleteFolder(id) {
  return request({
    url: 'archive/collection/receive/folder/' + id,
    method: 'delete'
  })
}

// 组件列表
export function getFileList(query) {
  return request({
    url: '/archive/collection/receive/file/list',
    method: 'get',
    params: query
  })
}

// 组件著录
export function addFile(data) {
  return request({
    url: '/archive/collection/receive/add/file',
    method: 'post',
    data: data
  })
}

// 获取卷详情
export function getFileDetail(id) {
  return request({
    url: '/archive/collection/receive/file/' + id,
    method: 'get'
  })
}

// 组件修改
export function updateFile(data) {
  return request({
    url: '/archive/collection/receive/edit/file',
    method: 'put',
    data: data
  })
}

// 组件删除
export function deleteFile(id) {
  return request({
    url: '/archive/collection/receive/file/' + id,
    method: 'delete'
  })
}
